home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 09 - 1993 / 09.07 Jul 93 / Bedrock Header Files / Strings Includes / BRWidStr.h < prev   
Encoding:
C/C++ Source or Header  |  1993-04-19  |  8.8 KB  |  239 lines  |  [TEXT/MPS ]

  1. #ifndef BRWIDSTR_H
  2. #define BRWIDSTR_H
  3. //========================================================================================
  4. //
  5. //     File:        BRWidStr.h
  6. //     Release Version:    $ 1.0d1 $
  7. //
  8. //     Creation Date:    4/2/93
  9. //
  10. //     COPYRIGHT 1993 SYMANTEC CORPORATION. ALL RIGHTS RESERVED. UNPUBLISHED -- RIGHTS
  11. //     RESERVED UNDER THE COPYRIGHT LAWS OF THE UNITED STATES. USE OF COPYRIGHT NOTICE IS
  12. //     PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION OR DISCLOSURE.
  13. //
  14. //     THIS SOFTWARE CONTAINS PROPRIETARY AND CONFIDENTIAL INFORMATION OF SYMANTEC
  15. //     CORPORATION. USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
  16. //     EXPRESS WRITTEN PERMISSION OF SYMANTEC CORPORATION.
  17. //
  18. //     RESTRICTED RIGHTS LEGEND
  19. //     Use, duplication, or disclosure by the Government is subject to restrictions as set
  20. //     forth in subparagraph (c)(l)(ii) of the Rights in Technical Data and Computer
  21. //     Software clause at DFARS 252.227-7013. Symantec Corporation, 10201 Torre Avenue,
  22. //     Cupertino, CA 95014.
  23. //
  24. //========================================================================================
  25.  
  26. #ifndef BRCHARAC_H
  27. #include "BRCharac.h"
  28. #endif
  29.  
  30. #ifndef BRTSTRS_H
  31. #include "BRTStrs.h"
  32. #endif
  33.  
  34. #ifndef BRCHARIT_H
  35. #include "BRCharIt.h"
  36. #endif
  37.  
  38. //========================================================================================
  39. //    CLASS BR_CDynamicWideCharString
  40. //========================================================================================
  41.  
  42. class BR_CDynamicWideCharString : public BR_TDynamicString<BR_WideChar>
  43. {
  44.     friend class BR_TStringWriter<BR_WideChar, BR_CDynamicWideCharString>;
  45.     
  46. public:
  47.  
  48.     ~BR_CDynamicWideCharString();
  49.     BR_CDynamicWideCharString();
  50.     BR_CDynamicWideCharString(const BR_TString<BR_WideChar> &string);
  51.     BR_CDynamicWideCharString(const BR_WideChar* items, BR_CharacterCount numberItems);
  52.     BR_CDynamicWideCharString(const BR_WideChar* items);
  53.     
  54.     BR_CDynamicWideCharString(const BR_TString<BR_Char> &string);
  55.     BR_CDynamicWideCharString(const BR_Char *items, BR_CharacterCount numberItems);
  56.     BR_CDynamicWideCharString(const BR_Char *items);
  57.  
  58.     BR_TString<BR_WideChar>& operator=(const BR_TString<BR_WideChar>& string);
  59.     BR_TString<BR_WideChar>& operator=(const BR_WideChar* string);
  60.  
  61.     BR_TString<BR_WideChar>& operator=(const BR_TString<BR_Char>& string);
  62.     BR_TString<BR_WideChar>& operator=(const BR_Char* string);
  63. };
  64.  
  65. //----------------------------------------------------------------------------------------
  66. //    BR_CDynamicWideCharString::operator=
  67. //----------------------------------------------------------------------------------------
  68.  
  69. inline BR_TString<BR_WideChar>& 
  70. BR_CDynamicWideCharString::operator=(const BR_TString<BR_WideChar>& string)
  71. {
  72.     if (&string != this)
  73.         ReplaceAll(string);
  74.     return *this;
  75. }
  76.  
  77. //----------------------------------------------------------------------------------------
  78. //    BR_CDynamicWideCharString::operator=
  79. //----------------------------------------------------------------------------------------
  80.  
  81. inline BR_TString<BR_WideChar>& 
  82. BR_CDynamicWideCharString::operator=(const BR_WideChar* string)
  83. {
  84.     ReplaceAll(string, BR_StringLength(string));
  85.     return *this;
  86. }
  87.  
  88. //========================================================================================
  89. //    CLASS BR_CDynamicWideCharStringWriter
  90. //========================================================================================
  91.  
  92. class BR_CDynamicWideCharStringWriter : public BR_TStringWriter<BR_WideChar, BR_CDynamicWideCharString>
  93. {
  94. public:
  95.     BR_CDynamicWideCharStringWriter(BR_CDynamicWideCharString &string, BR_TextWriterMode mode=BR_kTextAppend) :  
  96.         BR_TStringWriter<BR_WideChar, BR_CDynamicWideCharString>(string, mode) {}
  97. };
  98.  
  99. //========================================================================================
  100. //    CLASS BR_CWideCharString255
  101. //========================================================================================
  102.  
  103. const unsigned short BR_kWideCharString255Capacity = 255;
  104.  
  105. class BR_CWideCharString255 : public BR_TBoundedString<BR_WideChar, 255>
  106. {
  107.     friend class BR_TStringWriter<BR_WideChar, BR_CWideCharString255>;
  108.  
  109. public:
  110.     ~BR_CWideCharString255();
  111.     BR_CWideCharString255();
  112.     BR_CWideCharString255(const BR_TString<BR_WideChar> &string);
  113.     BR_CWideCharString255(const BR_WideChar* items, BR_CharacterCount numberItems);
  114.     BR_CWideCharString255(const BR_WideChar* items);
  115.     
  116.     
  117.     BR_CWideCharString255(const BR_TString<BR_Char> &string);
  118.     BR_CWideCharString255(const BR_Char *items, BR_CharacterCount numberItems);
  119.     BR_CWideCharString255(const BR_Char *items);
  120.  
  121.     BR_TString<BR_WideChar>& operator=(const BR_TString<BR_WideChar>& string);
  122.     BR_TString<BR_WideChar>& operator=(const BR_WideChar* string);
  123.  
  124.     BR_TString<BR_WideChar>& operator=(const BR_TString<BR_Char>& string);
  125.     BR_TString<BR_WideChar>& operator=(const BR_Char* string);
  126. };
  127.  
  128. //----------------------------------------------------------------------------------------
  129. //    BR_CWideCharString255::operator=
  130. //----------------------------------------------------------------------------------------
  131.  
  132. inline BR_TString<BR_WideChar>& 
  133. BR_CWideCharString255::operator=(const BR_TString<BR_WideChar>& string)
  134. {
  135.     if (&string != this)
  136.         ReplaceAll(string);
  137.     return *this;
  138. }
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    BR_CWideCharString255::operator=
  142. //----------------------------------------------------------------------------------------
  143.  
  144. inline BR_TString<BR_WideChar>& 
  145. BR_CWideCharString255::operator=(const BR_WideChar* string)
  146. {
  147.     ReplaceAll(string, BR_StringLength(string));
  148.     return *this;
  149. }
  150.  
  151. //========================================================================================
  152. //    CLASS BR_CWideCharString255Writer
  153. //========================================================================================
  154.  
  155. class BR_CWideCharString255Writer : public BR_TStringWriter<BR_WideChar, 
  156.                                                             BR_CWideCharString255>
  157. {
  158. public:
  159.     BR_CWideCharString255Writer(BR_CWideCharString255 &string, BR_TextWriterMode mode=BR_kTextAppend) :  
  160.         BR_TStringWriter<BR_WideChar, BR_CWideCharString255>(string, mode) {}
  161. };
  162.  
  163. //========================================================================================
  164. //    CLASS BR_CWideCharString32
  165. //========================================================================================
  166.  
  167. const unsigned short BR_kWideCharString32Capacity = 32;
  168.  
  169. class BR_CWideCharString32 : public BR_TBoundedString<BR_WideChar, 32>
  170. {
  171.     friend class BR_TStringWriter<BR_WideChar, BR_CWideCharString32>;
  172.  
  173. public:
  174.     ~BR_CWideCharString32();
  175.     BR_CWideCharString32();
  176.     BR_CWideCharString32(const BR_TString<BR_WideChar> &string);
  177.     BR_CWideCharString32(const BR_WideChar* items, BR_CharacterCount numberItems);
  178.     BR_CWideCharString32(const BR_WideChar* items);
  179.     
  180.     
  181.     BR_CWideCharString32(const BR_TString<BR_Char> &string);
  182.     BR_CWideCharString32(const BR_Char *items, BR_CharacterCount numberItems);
  183.     BR_CWideCharString32(const BR_Char *items);
  184.  
  185.     BR_TString<BR_WideChar>& operator=(const BR_TString<BR_WideChar>& string);
  186.     BR_TString<BR_WideChar>& operator=(const BR_WideChar* string);
  187.  
  188.     BR_TString<BR_WideChar>& operator=(const BR_TString<BR_Char>& string);
  189.     BR_TString<BR_WideChar>& operator=(const BR_Char* string);
  190. };
  191.  
  192. //----------------------------------------------------------------------------------------
  193. //    BR_CWideCharString32::operator=
  194. //----------------------------------------------------------------------------------------
  195.  
  196. inline BR_TString<BR_WideChar>& 
  197. BR_CWideCharString32::operator=(const BR_TString<BR_WideChar>& string)
  198. {
  199.     if (&string != this)
  200.         ReplaceAll(string);
  201.     return *this;
  202. }
  203.  
  204. //----------------------------------------------------------------------------------------
  205. //    BR_CWideCharString32::operator=
  206. //----------------------------------------------------------------------------------------
  207.  
  208. inline BR_TString<BR_WideChar>& 
  209. BR_CWideCharString32::operator=(const BR_WideChar* string)
  210. {
  211.     ReplaceAll(string, BR_StringLength(string));
  212.     return *this;
  213. }
  214.  
  215. //========================================================================================
  216. //    CLASS BR_CWideCharString32Writer
  217. //========================================================================================
  218.  
  219. class BR_CWideCharString32Writer : public BR_TStringWriter<BR_WideChar, 
  220.                                                             BR_CWideCharString32>
  221. {
  222. public:
  223.     BR_CWideCharString32Writer(BR_CWideCharString32 &string, BR_TextWriterMode mode=BR_kTextAppend) :  
  224.         BR_TStringWriter<BR_WideChar, BR_CWideCharString32>(string, mode) {}
  225. };
  226.  
  227. //========================================================================================
  228. //    CLASS BR_CUniversalWideCharStringReader
  229. //========================================================================================
  230.  
  231. class BR_CUniversalWideCharStringReader : public BR_TUniversalStringReader<BR_WideChar>
  232. {
  233. public:
  234.     BR_CUniversalWideCharStringReader(const BR_TString<BR_WideChar> &string) :  
  235.         BR_TUniversalStringReader<BR_WideChar>(string) {}
  236. };
  237.  
  238. #endif
  239.